package jimo.springboot.controller;

import jimo.springboot.pojo.User;
import jimo.springboot.service.UserService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.RequestMapping;

import java.util.List;

@Controller
public class UserController {
    @Autowired
    private UserService userService;
    @RequestMapping("/all")
    public String all(Model model){
        List<User> list = userService.queryAll();
        model.addAttribute("users",list);
        return "users";
    }
}
